Optimal. Leaf size=157 \[ -a \left (a^2-3 b^2\right ) x-\frac {a \left (a^2-3 b^2\right ) \cot (c+d x)}{d}+\frac {b \left (3 a^2-b^2\right ) \cot ^2(c+d x)}{2 d}+\frac {a \left (a^2-3 b^2\right ) \cot ^3(c+d x)}{3 d}-\frac {11 a^2 b \cot ^4(c+d x)}{20 d}+\frac {b \left (3 a^2-b^2\right ) \log (\sin (c+d x))}{d}-\frac {a^2 \cot ^5(c+d x) (a+b \tan (c+d x))}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.20, antiderivative size = 157, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3646, 3709,
3610, 3612, 3556} \begin {gather*} \frac {a \left (a^2-3 b^2\right ) \cot ^3(c+d x)}{3 d}+\frac {b \left (3 a^2-b^2\right ) \cot ^2(c+d x)}{2 d}-\frac {a \left (a^2-3 b^2\right ) \cot (c+d x)}{d}+\frac {b \left (3 a^2-b^2\right ) \log (\sin (c+d x))}{d}-a x \left (a^2-3 b^2\right )-\frac {11 a^2 b \cot ^4(c+d x)}{20 d}-\frac {a^2 \cot ^5(c+d x) (a+b \tan (c+d x))}{5 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3556
Rule 3610
Rule 3612
Rule 3646
Rule 3709
Rubi steps
\begin {align*} \int \cot ^6(c+d x) (a+b \tan (c+d x))^3 \, dx &=-\frac {a^2 \cot ^5(c+d x) (a+b \tan (c+d x))}{5 d}+\frac {1}{5} \int \cot ^5(c+d x) \left (11 a^2 b-5 a \left (a^2-3 b^2\right ) \tan (c+d x)-b \left (4 a^2-5 b^2\right ) \tan ^2(c+d x)\right ) \, dx\\ &=-\frac {11 a^2 b \cot ^4(c+d x)}{20 d}-\frac {a^2 \cot ^5(c+d x) (a+b \tan (c+d x))}{5 d}+\frac {1}{5} \int \cot ^4(c+d x) \left (-5 a \left (a^2-3 b^2\right )-5 b \left (3 a^2-b^2\right ) \tan (c+d x)\right ) \, dx\\ &=\frac {a \left (a^2-3 b^2\right ) \cot ^3(c+d x)}{3 d}-\frac {11 a^2 b \cot ^4(c+d x)}{20 d}-\frac {a^2 \cot ^5(c+d x) (a+b \tan (c+d x))}{5 d}+\frac {1}{5} \int \cot ^3(c+d x) \left (-5 b \left (3 a^2-b^2\right )+5 a \left (a^2-3 b^2\right ) \tan (c+d x)\right ) \, dx\\ &=\frac {b \left (3 a^2-b^2\right ) \cot ^2(c+d x)}{2 d}+\frac {a \left (a^2-3 b^2\right ) \cot ^3(c+d x)}{3 d}-\frac {11 a^2 b \cot ^4(c+d x)}{20 d}-\frac {a^2 \cot ^5(c+d x) (a+b \tan (c+d x))}{5 d}+\frac {1}{5} \int \cot ^2(c+d x) \left (5 a \left (a^2-3 b^2\right )+5 b \left (3 a^2-b^2\right ) \tan (c+d x)\right ) \, dx\\ &=-\frac {a \left (a^2-3 b^2\right ) \cot (c+d x)}{d}+\frac {b \left (3 a^2-b^2\right ) \cot ^2(c+d x)}{2 d}+\frac {a \left (a^2-3 b^2\right ) \cot ^3(c+d x)}{3 d}-\frac {11 a^2 b \cot ^4(c+d x)}{20 d}-\frac {a^2 \cot ^5(c+d x) (a+b \tan (c+d x))}{5 d}+\frac {1}{5} \int \cot (c+d x) \left (5 b \left (3 a^2-b^2\right )-5 a \left (a^2-3 b^2\right ) \tan (c+d x)\right ) \, dx\\ &=-a \left (a^2-3 b^2\right ) x-\frac {a \left (a^2-3 b^2\right ) \cot (c+d x)}{d}+\frac {b \left (3 a^2-b^2\right ) \cot ^2(c+d x)}{2 d}+\frac {a \left (a^2-3 b^2\right ) \cot ^3(c+d x)}{3 d}-\frac {11 a^2 b \cot ^4(c+d x)}{20 d}-\frac {a^2 \cot ^5(c+d x) (a+b \tan (c+d x))}{5 d}+\left (b \left (3 a^2-b^2\right )\right ) \int \cot (c+d x) \, dx\\ &=-a \left (a^2-3 b^2\right ) x-\frac {a \left (a^2-3 b^2\right ) \cot (c+d x)}{d}+\frac {b \left (3 a^2-b^2\right ) \cot ^2(c+d x)}{2 d}+\frac {a \left (a^2-3 b^2\right ) \cot ^3(c+d x)}{3 d}-\frac {11 a^2 b \cot ^4(c+d x)}{20 d}+\frac {b \left (3 a^2-b^2\right ) \log (\sin (c+d x))}{d}-\frac {a^2 \cot ^5(c+d x) (a+b \tan (c+d x))}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 1.00, size = 152, normalized size = 0.97 \begin {gather*} -\frac {a \left (a^2-3 b^2\right ) \cot (c+d x)-\frac {1}{2} b \left (3 a^2-b^2\right ) \cot ^2(c+d x)-\frac {1}{3} a \left (a^2-3 b^2\right ) \cot ^3(c+d x)+\frac {3}{4} a^2 b \cot ^4(c+d x)+\frac {1}{5} a^3 \cot ^5(c+d x)-\frac {1}{2} (i a+b)^3 \log (i-\cot (c+d x))+\frac {1}{2} (i a-b)^3 \log (i+\cot (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.20, size = 131, normalized size = 0.83
method | result | size |
derivativedivides | \(\frac {a^{3} \left (-\frac {\left (\cot ^{5}\left (d x +c \right )\right )}{5}+\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}-\cot \left (d x +c \right )-d x -c \right )+3 a^{2} b \left (-\frac {\left (\cot ^{4}\left (d x +c \right )\right )}{4}+\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\sin \left (d x +c \right )\right )\right )+3 b^{2} a \left (-\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}+\cot \left (d x +c \right )+d x +c \right )+b^{3} \left (-\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) | \(131\) |
default | \(\frac {a^{3} \left (-\frac {\left (\cot ^{5}\left (d x +c \right )\right )}{5}+\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}-\cot \left (d x +c \right )-d x -c \right )+3 a^{2} b \left (-\frac {\left (\cot ^{4}\left (d x +c \right )\right )}{4}+\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\sin \left (d x +c \right )\right )\right )+3 b^{2} a \left (-\frac {\left (\cot ^{3}\left (d x +c \right )\right )}{3}+\cot \left (d x +c \right )+d x +c \right )+b^{3} \left (-\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) | \(131\) |
norman | \(\frac {-\frac {a^{3}}{5 d}+\frac {a \left (a^{2}-3 b^{2}\right ) \left (\tan ^{2}\left (d x +c \right )\right )}{3 d}-\frac {a \left (a^{2}-3 b^{2}\right ) \left (\tan ^{4}\left (d x +c \right )\right )}{d}-a \left (a^{2}-3 b^{2}\right ) x \left (\tan ^{5}\left (d x +c \right )\right )-\frac {3 a^{2} b \tan \left (d x +c \right )}{4 d}+\frac {b \left (3 a^{2}-b^{2}\right ) \left (\tan ^{3}\left (d x +c \right )\right )}{2 d}}{\tan \left (d x +c \right )^{5}}+\frac {b \left (3 a^{2}-b^{2}\right ) \ln \left (\tan \left (d x +c \right )\right )}{d}-\frac {b \left (3 a^{2}-b^{2}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) | \(178\) |
risch | \(-3 i x b \,a^{2}+i b^{3} x -a^{3} x +3 a \,b^{2} x -\frac {6 i b \,a^{2} c}{d}+\frac {2 i b^{3} c}{d}+\frac {44 i a \,b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-\frac {46 i a^{3}}{15}-12 a^{2} b \,{\mathrm e}^{8 i \left (d x +c \right )}+2 b^{3} {\mathrm e}^{8 i \left (d x +c \right )}-6 i a^{3} {\mathrm e}^{8 i \left (d x +c \right )}+\frac {28 i a^{3} {\mathrm e}^{2 i \left (d x +c \right )}}{3}+24 a^{2} b \,{\mathrm e}^{6 i \left (d x +c \right )}-6 b^{3} {\mathrm e}^{6 i \left (d x +c \right )}+12 i a \,b^{2} {\mathrm e}^{8 i \left (d x +c \right )}+8 i a \,b^{2}-24 a^{2} b \,{\mathrm e}^{4 i \left (d x +c \right )}+6 b^{3} {\mathrm e}^{4 i \left (d x +c \right )}-36 i a \,b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+12 i a^{3} {\mathrm e}^{6 i \left (d x +c \right )}+12 a^{2} b \,{\mathrm e}^{2 i \left (d x +c \right )}-2 b^{3} {\mathrm e}^{2 i \left (d x +c \right )}-28 i a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}-\frac {56 i a^{3} {\mathrm e}^{4 i \left (d x +c \right )}}{3}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{5}}+\frac {3 a^{2} b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}-\frac {b^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}\) | \(364\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.52, size = 158, normalized size = 1.01 \begin {gather*} -\frac {60 \, {\left (a^{3} - 3 \, a b^{2}\right )} {\left (d x + c\right )} + 30 \, {\left (3 \, a^{2} b - b^{3}\right )} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 60 \, {\left (3 \, a^{2} b - b^{3}\right )} \log \left (\tan \left (d x + c\right )\right ) + \frac {60 \, {\left (a^{3} - 3 \, a b^{2}\right )} \tan \left (d x + c\right )^{4} + 45 \, a^{2} b \tan \left (d x + c\right ) - 30 \, {\left (3 \, a^{2} b - b^{3}\right )} \tan \left (d x + c\right )^{3} + 12 \, a^{3} - 20 \, {\left (a^{3} - 3 \, a b^{2}\right )} \tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{5}}}{60 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.09, size = 173, normalized size = 1.10 \begin {gather*} \frac {30 \, {\left (3 \, a^{2} b - b^{3}\right )} \log \left (\frac {\tan \left (d x + c\right )^{2}}{\tan \left (d x + c\right )^{2} + 1}\right ) \tan \left (d x + c\right )^{5} + 15 \, {\left (9 \, a^{2} b - 2 \, b^{3} - 4 \, {\left (a^{3} - 3 \, a b^{2}\right )} d x\right )} \tan \left (d x + c\right )^{5} - 60 \, {\left (a^{3} - 3 \, a b^{2}\right )} \tan \left (d x + c\right )^{4} - 45 \, a^{2} b \tan \left (d x + c\right ) + 30 \, {\left (3 \, a^{2} b - b^{3}\right )} \tan \left (d x + c\right )^{3} - 12 \, a^{3} + 20 \, {\left (a^{3} - 3 \, a b^{2}\right )} \tan \left (d x + c\right )^{2}}{60 \, d \tan \left (d x + c\right )^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 3.05, size = 241, normalized size = 1.54 \begin {gather*} \begin {cases} \tilde {\infty } a^{3} x & \text {for}\: \left (c = 0 \vee c = - d x\right ) \wedge \left (c = - d x \vee d = 0\right ) \\x \left (a + b \tan {\left (c \right )}\right )^{3} \cot ^{6}{\left (c \right )} & \text {for}\: d = 0 \\- a^{3} x - \frac {a^{3}}{d \tan {\left (c + d x \right )}} + \frac {a^{3}}{3 d \tan ^{3}{\left (c + d x \right )}} - \frac {a^{3}}{5 d \tan ^{5}{\left (c + d x \right )}} - \frac {3 a^{2} b \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {3 a^{2} b \log {\left (\tan {\left (c + d x \right )} \right )}}{d} + \frac {3 a^{2} b}{2 d \tan ^{2}{\left (c + d x \right )}} - \frac {3 a^{2} b}{4 d \tan ^{4}{\left (c + d x \right )}} + 3 a b^{2} x + \frac {3 a b^{2}}{d \tan {\left (c + d x \right )}} - \frac {a b^{2}}{d \tan ^{3}{\left (c + d x \right )}} + \frac {b^{3} \log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} - \frac {b^{3} \log {\left (\tan {\left (c + d x \right )} \right )}}{d} - \frac {b^{3}}{2 d \tan ^{2}{\left (c + d x \right )}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 370 vs.
\(2 (149) = 298\).
time = 2.81, size = 370, normalized size = 2.36 \begin {gather*} \frac {6 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 45 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 70 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 120 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 540 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 120 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 660 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1800 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 960 \, {\left (a^{3} - 3 \, a b^{2}\right )} {\left (d x + c\right )} - 960 \, {\left (3 \, a^{2} b - b^{3}\right )} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right ) + 960 \, {\left (3 \, a^{2} b - b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - \frac {6576 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 2192 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 660 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1800 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 540 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 120 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 70 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 120 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 45 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, a^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5}}}{960 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.10, size = 166, normalized size = 1.06 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,\left (3\,a^2\,b-b^3\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,{\left (b+a\,1{}\mathrm {i}\right )}^3}{2\,d}-\frac {{\mathrm {cot}\left (c+d\,x\right )}^5\,\left ({\mathrm {tan}\left (c+d\,x\right )}^2\,\left (a\,b^2-\frac {a^3}{3}\right )-{\mathrm {tan}\left (c+d\,x\right )}^4\,\left (3\,a\,b^2-a^3\right )-{\mathrm {tan}\left (c+d\,x\right )}^3\,\left (\frac {3\,a^2\,b}{2}-\frac {b^3}{2}\right )+\frac {a^3}{5}+\frac {3\,a^2\,b\,\mathrm {tan}\left (c+d\,x\right )}{4}\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )\,{\left (a+b\,1{}\mathrm {i}\right )}^3\,1{}\mathrm {i}}{2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________